import request from "@/utils/request";

let cacheWarehouseList = [];

export default {
  data() {
    return {
      warehouseList: [],
    }
  },
  created() {
    this.getWarehouseList();
  },
  methods: {
    getWarehouseList() {
      if(cacheWarehouseList.length > 0){
        this.warehouseList = cacheWarehouseList
        this.warehouseFinish()
      }else{
        request({
          url: '/warehouse/getWarehouseList',
        })
          .then(res=>{
            this.warehouseList = res.data
            cacheWarehouseList = res.data
            this.warehouseFinish()
          })
      }
    },
    warehouseFinish(){

    }
  }
}
